// interface 接口名称 {
//   属性名称:属性类型;
//   方法名称():返回值类型;
// }
interface Person {
    name: string;
    age: number;
    sex?: string; // 可选属性

    sayHello(): number;
}

let student: Person = {
    name: "张三",
    age: 18,
    sex: "",
    // city:"长沙",

    sayHello(){
        console.log("hello world");
        return 1;
    }
}
console.log(student)

// 定义函数接口
interface GreetFunction{
    (name:string):void;
}
let greet:GreetFunction = function(name:string){
    console.log("hello " + name);
}

greet("张三")
